package com.toolkit.exceptionHandler;

import com.toolkit.enumData.ExceptionCodeMsg;

public class BusinessException extends RuntimeException{

    private int code;
    private String msg;


    public BusinessException(ExceptionCodeMsg appExceptionCodeMsg){
        super();
        this.code = appExceptionCodeMsg.getCode();
        this.msg = appExceptionCodeMsg.getMsg();

    }

    public BusinessException(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public String toString() {
        return "class= " + this.getClass() + " -code=" + this.getCode() + " -message=" + this.getMsg();
    }
}
